<template>
  <div>
    <h4>发表评论 ------{{newsid}}</h4>
    <hr />
    <textarea placeholder="请输入要BB的内容（最多1678字）" maxlength="678"></textarea>
    <mt-button type="primary" size="large">发表评论</mt-button>

    <!-- 评论列表去 -->
    <div class="cmt-list">
      <div class="cmt-item">
        <div class="cmt-item-title">第一楼&nbsp;用户：匿名用户&nbsp;</div>
        <div class="cmt-item-body">hhhhh</div>
      </div>
    </div>
    <mt-button type="danger" size="large" plain>加载更多</mt-button>
  </div>
</template>
<script>
export default {
  data() {
    return {
      pageindex:1,
    };
  },
  methods: {
    getCommentByPage() {
      this.$http     
        .get("api/getcomments/" + this.newsid + "?pageindex=1"  )
        .then(result => {         
          console.log(result);          
        });
    }
  },
  created() {
    this.getCommentByPage();
  },
  props: ["newsid"]
};
</script>


<style lang="scss" scope>
textarea {
  font-size: 14px;
  margin: 0;
}
.cmt-list {
  margin-top: 4px;
  .cmt-item {
    line-height: 30px;
    .cmt-item-title {
      font-size: 14px;
      background-color: #ddd;
    }
    .cmt-item-body {
      font-size: 13px;
      text-indent: 2em;
    }
  }
}
</style>